﻿using Canteen.Core.Common;
using Canteen.Core.Models;
using System.Threading.Tasks;

namespace Canteen.Core.Services
{
    public interface IUserService
    {
        Task<User> CreateUser(User user);
        Task<User> UpdateUser(User user);
        Task<bool> DeleteUser(int id);
        /// <summary>
        /// 充值
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="wallet"></param>
        /// <returns></returns>
        Task<decimal> RechargeWallet(RechargeRecordDTO rechargeRecord);
        Task<User> SelectUser();
        Task<User> SelectUserById(int id);
        Task<User> SelectUserByPhone(string phone);
        Task<User> SelectUserByPhoneAndPwd(string phone, string passWord);
        Task<PageList<User>> GetPageList(UserPageParameters parameters);

        Task<dynamic> GetRechargePageList(ShopOrderPageParameters parameters);

        #region 登录相关
        int UserId { get; }
        Task<User> UserLogin(string phone, string passWord);
        Task<JwtAuthResult> SetUserLogin(User user);
        #endregion
    }
}
